package org.edu.service.impl;

import java.util.List;

import org.edu.dao.UserDao;
import org.edu.model.User;
import org.edu.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service("userService")
public class UserServiceImpl implements UserService {

	@Autowired
	private UserDao userDao;
	public UserServiceImpl() {
		// TODO Auto-generated constructor stub
	}

	@Transactional
	public void save(User user) throws Exception {
		userDao.save(user);
	}

	@Transactional
	public void update(User user) throws Exception {
		userDao.update(user);
	}

	@Transactional
	public void delete(User user) throws Exception {
		userDao.delete(user);
	}

	@Transactional
	public User getUser(User user) throws Exception {
		return userDao.getUser(user);
	}

	@Transactional
	public List<User> users() {
		return userDao.users();
	}

	@Transactional
	public User findById(Long user_id) throws Exception {
		return userDao.findById(user_id);
	}


}
